package com.icbc.payfront.controller;

import com.icbc.payfront.service.QrCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

@RestController
public class QrCode {
    @Autowired
    private QrCodeService qrCodeService;

    /**
     * 二维码获取接口
     */
    @PostMapping("/bills/qrCode.do")
    public Object qrCode(@RequestHeader HttpHeaders headers, @RequestBody String jsonBody) {

        return qrCodeService.rqCode(jsonBody);
    }

    /**
     *  关闭二维码接口
     */
    @PostMapping("/bills/closeQRCode")
    public Object closeQRCode(@RequestHeader HttpHeaders headers,@RequestBody String jsonBody){

        return qrCodeService.closeQRCode(jsonBody);
    }

    /**
     *  账单查询接口
     */
    @PostMapping("/bills/query")
    public Object query(@RequestHeader HttpHeaders headers,@RequestBody String jsonBody){

        return qrCodeService.query(jsonBody);
    }

    /**
     * 退款接口
     */
    @PostMapping("/bills/refund")
    public Object refund(@RequestHeader HttpHeaders headers, @RequestBody String jsonBody) {

        return qrCodeService.refund(jsonBody);
    }


}
